﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KouDai.Core.Parser;

namespace KouDai.Core.Engine
{
    #region SendData
    public class SendData
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string ProxyName { get; set; }
        /// <summary>
        /// 发送请求的方式
        /// </summary>
        public SendMethod Method { get; set; }
        /// <summary>
        /// 加密方式
        /// </summary>
        public EncryptType EncryptType { get; set; }
        /// <summary>
        /// 头信息
        /// </summary>
        public Dictionary<string, object> Headers { get; set; }
        /// <summary>
        /// 体信息
        /// </summary>
        public Dictionary<string, object> Body { get; set; }
        /// <summary>
        /// 图片请求时的地址
        /// </summary>
        public string ImageUrl { get; set; }

        /// <summary>
        /// Json请求的构造方法
        /// 
        /// 全局的构造方法，可根据自己需要添加自己的构造方法，
        /// 但尽量少一些，避免混乱.
        /// </summary>
        /// <param name="proxyName"></param>
        /// <param name="method"></param>
        /// <param name="encrytpType"></param>
        /// <param name="headers"></param>
        /// <param name="body"></param>
        public SendData(string proxyName, SendMethod method, EncryptType encryptType, Dictionary<string, object> headers, Dictionary<string, object> body)
        {
            this.ProxyName = proxyName;
            this.Method = method;
            this.EncryptType = encryptType;
            this.Headers = headers;
            this.Body = body;
        }

        /// <summary>
        /// 图片请求的构造方法
        /// 
        /// </summary>
        /// <param name="imageUrl"></param>
        public SendData(string imageUrl)
        {
            this.ImageUrl = imageUrl;
        }
    }
    #endregion

    #region BackData
    public class BackData
    {
        public object ResposeData { get; set; }
        public string ErrorMsg { get; set; }
        public bool IsSuccess { get; set; }

        public BackData(object hopeData)
        {
            this.ResposeData = hopeData;
        }
    }
    #endregion

    #region CommunicationData
    public class CommunicationData
    {
        public SendData SendData { get; set; }
        public KouDaiParser Parser { get; set; }
        public BackData BackData { get; set; }
    }
    #endregion
   
}
